
local CommonOHOH = _G.CommonOHOH;
local ReadyBaseClass=script.Parent.Parent.Parent.ReayBattleCtrl.ReadyObj
local M = CommonOHOH.class.new(script, ReadyBaseClass);



function M.new(self, ...)
	return M(self, ...);
end;

function M.ctor(self,battleInst,...)


	M.super.ctor(self,battleInst,...);
    
end;


function M.InitBattleInfo(self,battleInst, id,cfg)
    self.Id=id
    self.Cfg=cfg
end


function M.Init(self)

end


function M.dtor(self)
	M.super.dtor(self);
end;


 
 -- 创建一场战斗
 function M.CreateBattle(self)
    local data=self:BattleData()
    local map=data.mapPerfab:Clone()
    map:SetPrimaryPartCFrame(self:GetMapAtt().WorldCFrame)
 
    local att= self:GetMapAtt()
    att.using.Value=true --将地图点位标记为使用中

    self:AddProcess(function()
        local battle= require(script.Parent.Battle).new(map,data.levelIdList,data.playerList,data.battleId,data.battleInst)
        battle.EndEvent:Connect(function()
            att.using.Value=false --将地图点位标记为未使用
        end)
    end)

end

return M;
